<template>
    <div class="app-body">
        <div class="app-search">
            <a>尚未签到人员列表</a>
        </div>
        <div>
            <el-button type="warning" plain  v-for="item in list" :key="item" :id="item.teacherNumber" class="btn-name">
                {{item.teacherName}}
            </el-button>
        </div>
    </div>
    <bottomView></bottomView>
</template>
<script>
    import {ElConfigProvider, ElMessageBox, ElMessage} from "element-plus";
    import zhCn from "element-plus/lib/locale/lang/zh-cn";
    import {httpService} from "@/utils/httpService";
    import bottomView from "@/components/bottom.vue";

    export default {
        name: "eCardList",
        data() {
            return {
                title: "",
                page: 1,
                total: 0,
                limit: 12,
                list: [],
                headerTitle:"",
                campus:"",
                year:"",
                fresh: null,
                form: {
                    studentName: "",
                    oneCardNumber:"",
                    idCard:""
                },
            };
        },
        components: {
            ElConfigProvider,
            ElMessageBox,
            bottomView,
            ElMessage
        },
        setup() {
            return {
                locale: zhCn,
            };
        },
        mounted() {
            this.dataRefresh();
        },
        methods: {
            reloadData(){
                this.page=1;
                this.getCardsList()
            },
            // 每页记录数改变，size：回调参数，表示当前选中的“每页条数”
            changePageSize(size) {
                this.pageSize = size;
                this.limit = size;
                this.getCardsList();
            },
            // 改变页码，page：回调参数，表示当前选中的“页码”
            changeCurrentPage(page) {
                this.page = page;
                this.getCardsList();
            },
            dataRefresh() {
                if(this.fresh != null){
                    return
                }
                this.fresh=setInterval(() => {
                    console.log('111111111');
                    this.getCardsList()
                }, 5000)
            },
            getCardsList() {
                let meetingId=this.$route.params.meetingId;
                httpService(
                    "/pythonApi/attendanceApi/getAttendanceResultsList",
                    {
                        meetingId:meetingId
                    },
                    "get"
                ).then((data) => {
                    this.list = data.data;
                });
            }
        },
    };
</script>
<style scoped>
.app-table {
    background: #eff3f5;
    padding: 10px;
    width: calc(100vw - 220px);
}

.app-search {
    text-align: center;
    margin-bottom: 5px;
    font-size: 30px;
}
.btn-name {
    margin-bottom: 20px;
    margin-left: 5px;
    width: 60px;
}

.app-body {
    background: white;
    padding: 20px 20px 10px 20px;
    margin-bottom: 10px;
    min-height: calc(100vh - 204px);
}
</style>